package com.shop.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.shop.service.UserService;

@Controller
public class UserController {
	@Resource
	private UserService seivce;

	@RequestMapping(value = "index")
	public ModelAndView userData(Model model) {
		System.out.println(1);
		model.addAttribute("user", this.seivce.getUserById(1));
		return new ModelAndView("index");
	}

	@RequestMapping(value = "user")
	public ModelAndView shop(Model model) {
		model.addAttribute("user", this.seivce.getUserById(1));
		return new ModelAndView("index");
	}
}
